import React from 'react';
import {Form, Icon, Upload} from 'antd';
import { UploadProps, UploadState } from 'antd/lib/upload/interface';
import '../HYUpload/HYUpload.less';
import ClassNames from "classnames";

export interface HYUploadInputProps extends UploadProps {}

class HYImageUpload extends React.Component<HYUploadInputProps, UploadState> {
  constructor(props) {
    super(props);
  }

  render() {
    const uploadButton = (
      <div>
        <Icon type="plus" />
        <div className="hy-upload-image-text">上传图片</div>
      </div>
    );
    const {className, ...rest} = this.props;
    return (
      <Upload
        className={ClassNames("hy-image-upload",className)}
        listType="picture-card"
        {...rest}
      >
        {uploadButton}
      </Upload>
    );
  }
}

export default HYImageUpload;
